package amend;

import com.lijinjiang.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;
import java.awt.*;

/**
 * @ClassName Amend09_JButton
 * @Description TODO
 * @Author Li
 * @Date 2022/9/16 9:16
 * @ModifyDate 2022/9/16 9:16
 * @Version 1.0
 */
public class Amend09_JButton {
    public static void main(String[] args) {
        try {
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
            BeautyEyeLNFHelper.launchBeautyEyeLNF();
        } catch (Exception e) {
            e.printStackTrace();
        }
        JFrame frame = new JFrame(); // 初始化窗口
        frame.setTitle("Amend09"); // 设置标题

        JPanel panel = new JPanel();// 中间组件
        panel.setLayout(new GridLayout(4, 3, 30, 30));

        JButton btn01 = new JButton("普通按钮");
        JButton btn02 = new JButton("红色按钮");
        JButton btn03 = new JButton("粉色按钮");
        JButton btn04 = new JButton("橘色按钮");
        JButton btn05 = new JButton("黄色按钮");
        JButton btn06 = new JButton("绿色按钮");
        JButton btn07 = new JButton("紫红色按钮");
        JButton btn08 = new JButton("青色按钮");
        JButton btn09 = new JButton("蓝色按钮");
        JButton btn10 = new JButton("灰色按钮");
        JButton btn11 = new JButton("黑色按钮");
        JButton btn12 = new JButton("禁用按钮");


        // 1.普通按钮
        panel.add(btn01);

        // 2.红色的按钮
        btn02.setOpaque(true);
        btn02.setBackground(Color.RED);
        panel.add(btn02);
        // 3.粉色的按钮
        btn03.setOpaque(true);
        btn03.setBackground(Color.PINK);
        panel.add(btn03);
        // 4.橘色的按钮
        btn04.setOpaque(true);
        btn04.setBackground(Color.ORANGE);
        panel.add(btn04);
        // 5.黄色的按钮
        btn05.setOpaque(true);
        btn05.setBackground(Color.YELLOW);
        panel.add(btn05);
        // 6.绿色的按钮
        btn06.setOpaque(true);
        btn06.setBackground(Color.GREEN);
        panel.add(btn06);
        // 7.紫红色的按钮
        btn07.setOpaque(true);
        btn07.setBackground(Color.MAGENTA);
        panel.add(btn07);
        // 8.青色的按钮
        btn08.setOpaque(true);
        btn08.setBackground(Color.CYAN);
        panel.add(btn08);
        // 9.蓝色的按钮
        btn09.setOpaque(true);
        btn09.setBackground(Color.BLUE);
        btn09.setForeground(Color.WHITE);
        panel.add(btn09);
        // 10.灰色的按钮
        btn10.setOpaque(true);
        btn10.setBackground(Color.GRAY);
        panel.add(btn10);
        // 11.黑色的按钮
        btn11.setOpaque(true);
        btn11.setBackground(Color.BLACK);
        btn11.setForeground(Color.WHITE);
        panel.add(btn11);


        // 9.禁用按钮
        btn12.setEnabled(false);
        panel.add(btn12);


        frame.add(panel);
        frame.setSize(new Dimension(400, 300)); // 显示大小
        frame.setLocationRelativeTo(null); // 屏幕居中
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设置默认关闭方式
        frame.setVisible(true);
    }
}
